package com.mytijian.code.exceptions;

import com.mytijian.exception.ErrorInfo;

/**
 * Created by shjh on 2017/9/23.
 */
public enum MashangExceptionEnum implements ErrorInfo {
	//系统相关
    SYSTEM_ERROR("200100", "码商系统异常"),
    BEAN_COPY_ERROR("200113", "对象复制错误"),
    NOTIFY_CODE_MERCHANT_PLATFORM_FAIL("200101", "回调码商发码接口失败"),
    //订单相关
    ORDER_NOT_EXIST("200102", "订单信息在码商处不存在"),
    ORDER_WAS_INVALID("200103", "订单已作废"),
    ORDER_STATUS_CANNOT_SEND_CODE("200112", "订单状态不满足发码条件"),
    ORDER_STATUS_CANNOT_RESEND_CODE("200115", "订单状态不满足重新发码条件"),
    ORDER_STATUS_CANNOT_RESEND("200113", "订单状态不可重新发码"),
    OUTERIDSKU_CANNOT_EMPTY("200117", "OuterIdSKU字段不能为空"),
    //码相关
    CODE_NOT_EXIST("200104", "电子码不存在"),
    CODE_CAN_NOT_CONSUME("200105", "电子码不能核销"),
    CODE_HAS_CONSUME("200106", "电子码已核销"),
    CODE_HAS_EXPIRED("200107", "电子码已过期"),
    CODE_HAS_REFUND("200108", "电子码已退款"),
    CONSUME_FAIL("200109", "核销失败"),  //这里只定义了异常码,异常信息取淘宝返回的异常说明
    CONSUME_AVAILABLE_FAIL("200110", "核销校验失败"),  //这里只定义了异常码,异常信息取淘宝返回的异常说明
    CREATE_CODE_ERROR("200111", "生成码失败"),
    REPETITION_SEND_CODE("200114", "重复发码"),
    SEND_CODE_NUM_DIFFERENT("200116", "重新发码数量有误");

    private String errorCode;
    private String errorMsg;

    private MashangExceptionEnum(String errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    @Override
    public String getErrorCode() {
        return errorCode;
    }

    @Override
    public String getErrorMsg() {
        return errorMsg;
    }

}
